package com.view.pages.worldtown.objects
{
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	
	import org.papervision3d.cameras.Camera3D;
	import org.papervision3d.materials.MovieMaterial;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Plane;

	public class Birds extends DisplayObject3D
	{
		private var $birdsPlane:Plane;
		
		public function Birds()
		{
			//TODO: implement function
			super();
			init();
		}
		private function init():void
		{
			var $birds:Sprite = new Sprite();
			var $brd:Bird = new Bird();
			$brd.x = 100;
			$brd.y = 100;
			$birds.addChild($brd);
			$birds.width = 600;
			$birds.height = 300;
			var $r:Rectangle = new Rectangle(0,0,600,300);
			var $bMm:MovieMaterial = new MovieMaterial($birds,true,true,false,$r);
			$birdsPlane = new Plane($bMm,2000,1000,1,1);
			$birdsPlane.y = 4000;
			$birdsPlane.z = 2000;
			addChild($birdsPlane);
		}
		public function update(_c:Camera3D):void
		{
			$birdsPlane.rotationY = _c.rotationY;
			$birdsPlane.rotationX = _c.rotationX;	
		}
		
	}
}